package com.pocket.cloud.common.client;

import com.pocket.cloud.common.api.ResultData;
import com.pocket.cloud.common.dto.OrderSettlementDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * FallbackClass：无法对远程调用的异常做处理；FallbackFactory：可以对远程调用的异常做处理
 * @author zhaozhile
 */
// @FeignClient(value = "pocket-payment", fallback = PaymentClientFallBack.class) // 【cloud-openfeign-3.2】
@FeignClient(value = "pocket-payment", fallbackFactory = PaymentClientFallBackFactory.class) // 【cloud-FeignClient-sentinel-4】
public interface PaymentClient {

    // 【cloud-openfeign-1.2】
    @GetMapping(value = "/payment/{orderNo}") // 与服务提供方的接口保持一致
    ResultData<OrderSettlementDTO> getPayByOrderNo(@PathVariable("orderNo") String orderNo);

}
